package com.yuhong.springbootinit.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yuhong.springbootinit.model.entity.CompanyUser;
import com.yuhong.springbootinit.service.CompanyUserService;
import com.yuhong.springbootinit.mapper.CompanyUserMapper;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
* @author 10467
* @description 针对表【company_user】的数据库操作Service实现
* @createDate 2025-02-22 13:52:10
*/
@Service
public class CompanyUserServiceImpl extends ServiceImpl<CompanyUserMapper, CompanyUser>
    implements CompanyUserService{

    @Resource
    private CompanyUserMapper companyUserMapper;

    @Override
    public CompanyUser getCompanyInfoByUserId(String userId) {

        QueryWrapper<CompanyUser> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("user_id", userId);
        CompanyUser companyUser = companyUserMapper.selectOne(queryWrapper);

        return companyUser;
    }
}




